* About

There is a wonderful tiny [[https://github.com/joukewitteveen/xlogin/blob/master/x-daemon.in][bash script]] (thanks to Jouke Witteveen for
this beauty!) that turns X server into a daemon.  Here is how it works:
when you run this script, it starts X server and catches USR1 signal.
When this signal is received, it means X server is ready to be used by
clients, e.g. you can run a window manager on it, etc.  This SIGUSR1
behaviour is documented in =man Xserver=.

So this =Xdaemon= script can be used by such service managing programs
as [[http://freedesktop.org/wiki/Software/systemd/][Systemd]] or [[http://www.gnu.org/software/shepherd/][Shepherd]] (I use it in my [[https://github.com/alezost/shepherd-config][Shepherd config]]).

This repository exists because I wanted to make a general-purpose
package that can be built using [[https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/The-GNU-Build-System.html#The-GNU-Build-System][The GNU Build System]].  Also I added
=Xkill= script that allows to kill an X server running on a particular
DISPLAY.

* Building from Git

Requirements for building from git:

- [[http://gnu.org/software/autoconf/][GNU Autoconf]]
- [[http://gnu.org/software/automake/][GNU Automake]]

Run =./autogen.sh= to generate the build system infrastructure.
=./autogen.sh= just runs =autoreconf= to generate "configure" script.
This phase is not needed for a release that already contains "configure"
and "Makefile.in" files (such a release is generated with "make dist"
command).

After that, the program can be built and installed with the usual
sequence of commands of the GNU Build System:

#+BEGIN_SRC sh
./configure
make
make install
#+END_SRC

If you are not familiar with the GNU build system, here are some
comments:

- =configure= phase creates final files from ".in" files ("Makefile",
  "src/Xdaemon" and "src/Xkill").

- Actually, invoking =make= (before =make install=) does nothing by
  itself as there is nothing to compile – the ready-to-use scripts are
  generated during the =configure= phase.

- Finally, =make install= installs scripts to [[/usr/local/bin]] or another
  configured directory (see "./configure -h").

* Building with Guix

This repository contains =guix.scm= file which can be used to build the
development version of this package with [[http://www.gnu.org/software/guix/][GNU Guix]].

A Guix package for the latest release can be found in my [[https://github.com/alezost/guix-config/blob/master/packages/x.scm][guix-config]]
repository.
